<template>
   <div class="bargain views-container">
    <div class="wlm-table">
      <div class="wlm-table-header" style="margin-bottom:20px;">
            <div class="dashboard-header">
                <!--  -->
               <el-form :model="tableFormatData.lotteryAddList.files" size="small" label-width="95px" class="retail-form" label-position="right">
                    <el-form-item label class="filter">
                        <el-form-item label="抽奖标题：">
                            <!--  -->
                        <el-input @keyup.enter.native="filesSerch" v-model="tableFormatData.lotteryAddList.files.luck_title" placeholder="请输入抽奖标题" style="width:160px;"></el-input>
                        </el-form-item>
                        <el-form-item label="用户昵称：">
                         <el-input @keyup.enter.native="filesSerch" v-model="tableFormatData.lotteryAddList.files.nickName" placeholder="请输入用户昵称" style="width:160px;"></el-input>
                        </el-form-item>
                        <el-form-item label="抽奖码：">
                            <el-input @keyup.enter.native="filesSerch" v-model="tableFormatData.lotteryAddList.files.luck_code" placeholder="请输入抽奖码" style="width:160px;"></el-input>
                        </el-form-item>

                    </el-form-item>
                    <el-form-item label class="filter-btns">
                        <el-button type="primary" @click="filesSerch">筛选</el-button>
                        <el-button type="text" @click="filesEmpty">清空筛选条件</el-button>
                    </el-form-item>
                </el-form>
            </div>

      </div>
      <div class="wlm-table-content">
                 <!-- :ref="tableFormatData.userTable.key" :data="tableFormatData.userTable.tableData" @selection-change="handleSelectionChange" -->
                  <el-table  :ref="tableFormatData.lotteryAddList.key" :data="tableFormatData.lotteryAddList.tableData" @selection-change="handleSelectionChange"  style="width: 100%">
                      <el-table-column prop="date" label="订单编号" min-width="30">
                        <template slot-scope="scope">
                           <span>{{scope.row.no}}</span>
                        </template>
                      </el-table-column>
                      <el-table-column prop="date" label="用户" min-width="30">
                        <template slot-scope="scope">
                             <div class="wlm-table-logos">
                                  <div style="display:flex;">
                                        <img
                                            class="logo"
                                            :src="scope.row.avatarUrl"
                                            >
                                         <div style="margin-left:10px;">
                                                <div style="font-size:12px">{{scope.row.user_id}}</div>
                                            <span style="font-size:12px">{{scope.row.nickName}}</span>
                                         </div>
                                  </div>
                                </div>
                        </template>
                      </el-table-column>
                       <el-table-column prop="date" label="抽奖标题" min-width="30">
                        <template slot-scope="scope">
                           <span>{{scope.row.luck_title}}</span>
                        </template>
                      </el-table-column>
                      <el-table-column prop="date" label="抽奖码" min-width="30">
                        <template slot-scope="scope">
                           <span>{{scope.row.luck_code}}</span>
                        </template>
                      </el-table-column>
                       <el-table-column prop="date" label="付款状态" min-width="30">
                        <template slot-scope="scope">
                           <div v-if="scope.row.pay_status==20">{{'已付款'}}</div>
                           <div v-if="scope.row.pay_status==10">{{'未付款'}}</div>
                        </template>
                      </el-table-column>
                      <el-table-column prop="date" label="支付方式" min-width="30">
                        <template slot-scope="scope">
                           <span v-if="scope.row.pay_type=='admin'">{{'后台确认支付'}}</span>
                           <span v-if="scope.row.pay_type=='wechat'">{{'微信'}}</span>
                           <span v-if="scope.row.pay_type=='alipay'">{{'支付宝'}}</span>
                           <span v-if="scope.row.pay_type=='balance'">{{'余额'}}</span>
                           <span v-if="scope.row.pay_type=='zero'">{{'零元购'}}</span>

                        </template>
                      </el-table-column>
                      <el-table-column prop="date" label="支付金额" min-width="30">
                        <template slot-scope="scope">
                           <span>{{scope.row.pay_price}}</span>
                            <div>
                                  <el-tooltip class="item" effect="dark" :content="sourceType[`${scope.row.source}`]" placement="top">
                                <img height="20" width="20" :src="sourceImg[`${scope.row.source || '-'}`]" alt />
                            </el-tooltip>
                            </div>
                        </template>
                      </el-table-column>
                      <el-table-column prop="date" label="订单创建时间" min-width="30">
                        <template slot-scope="scope">
                           <span>{{scope.row.create_time}}</span>
                        </template>
                      </el-table-column>
                       <el-table-column prop="date" label="订单支付时间" min-width="30">
                        <template slot-scope="scope">
                           <span>{{scope.row.update_time}}</span>
                        </template>
                      </el-table-column>
                  </el-table>
                  <div class="pagination-content flex-row flex-justify-e flex-align-c">

                <el-pagination
                    :disabled="!hasTableData"
                    @size-change="listPageChange"
                    @current-change="listPageChange"
                    :current-page.sync="tableFormatData.lotteryAddList.pagination.page"
                    :page-sizes="tableFormatData.lotteryAddList.pagination.pagesizes"
                    :page-size.sync="tableFormatData.lotteryAddList.pagination.list_rows"
                    layout="total, sizes, prev, pager, next, jumper"
                    :total="hasTableData?tableFormatData.lotteryAddList.pagination.total : 0"
                ></el-pagination>
                </div>
             </div>
    </div>
   </div>
</template>
<script>
import {
  luckOrder
} from '@/api/application'
import mixins from '@/mixins/mixins'
export default {
  mixins: [mixins.getters('Table')],
  name: 'LotteryAddList',
  data() {
    return {
      tableFormatData: {
        current: 'lotteryAddList',
        lotteryAddList: {
          key: 'lotteryAddList',
          api: {
            getList: luckOrder
          },
          tableData: [],
          files: {
            luck_title: '',
            nickName: '',
            luck_code: '',
            ids: [],
            checkall: '0',
            Recycle: '1'
          },
          pagination: {
            page: 1,
            list_rows: 10,
            pagesizes: [10, 20, 50],
            total: 0
          }
        }
      }
    }
  }
}
</script>
<style lang="scss" scoped>

</style>
